package com.example.anote;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ProgressBar;
import android.widget.RatingBar;
import android.widget.SimpleCursorAdapter;
import android.widget.Spinner;
import android.widget.TextView;

public class AddActivity extends Activity {

	private ListView ListViewItem;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTitle("Ajout");
		setContentView(R.layout.activity_add);
		
		
		
		
		
		
		
		
		
		
		
		
		final ImageButton saveButton = (ImageButton) findViewById(R.id.saveadd);
		saveButton.setOnClickListener(new View.OnClickListener() {
                        
        @Override
        public void onClick(View v) {

        	TextView txt = (TextView) AddActivity.this.findViewById(R.id.titreadd);
        	ProgressBar proc = (ProgressBar) AddActivity.this.findViewById(R.id.seekBaradd);
        	TextView desc = (TextView) AddActivity.this.findViewById(R.id.descradd);
        	
        	StaticStore.NoteStore = new NoteList(0, txt.getText().toString(), desc.getText().toString(), proc.getProgress(), 0);
    		
    		setResult(1);
        	AddActivity.this.finish();
        	
        }
        	});
		
		
		
		
		
		
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.add, menu);
		return true;
	}

}
